knitr::opts_knit$set(root.dir = '../../../')
library(stringr)
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Load data
data <- read.table('report/promoter_upstream_downstream_10kb/fetalBrain/intersect.SRX026914.bed.gz', sep = '\t', header = F)
v11.good <- is.na(str_match(data$V14, '[ATGC]'))
v11.strategy1 <- str_match(data$V14, '(.+),.+,.+,.+')
v12.good <- is.na(str_match(data$V15, '[ATGC]'))
v12.strategy1 <- str_match(data$V15, '(.+),.+,.+,.+')
strategy1 <- v11.strategy1
strategy1[v12.good, ] <- v12.strategy1[v12.good, ]
# strategy1 <- str_match(data$V12, '(.+),.+,.+,.+')
strategy1 <- strategy1[, 2]
class(strategy1) <- 'numeric'
data <- data.frame(strategy1 = strategy1, centisnp = data$V7, motif = data$V4, position = data$V2, strand = data$V6)
data <- unique(data)
motifs <- unique(data$motif)
Include all motifs
ggplot(data) + geom_point(aes(x = centisnp, y = strategy1)) +
geom_abline(slope = 1, intercept = 0, color = 'red') +
ggtitle('All motifs')

for (i in motifs){
data.sub <- data[data$motif == i, ]
cat('\n')
cat("#", paste('Motif', i), "\n")
# cat("\n")
print(ggplot(data.sub) + geom_point(aes(x = centisnp, y = strategy1)) +
geom_abline(slope = 1, intercept = 0, color = 'red'))
# cat("\n")
cat("\n")
}
Motif M01620

Motif M00084

Motif PBM0087

Motif M01259

Motif MA0018.2

Motif M00338

Motif M00778

Motif M00797

Motif M01182

Motif M01951

Motif M01935

Motif MA0006.1

Motif M02011

Motif MA0093.1

Motif M00799

Motif MA0004.1

Motif M01699

Motif MA0076.1

Motif M01990

Motif M01986

Motif M01167

Motif M00032

Motif M00244

Motif MA0100.1

Motif PBM0203

Motif M00428

Motif M00986

Motif M00491

Motif M01639

Motif M01241

Motif M00108

Motif M01714

Motif M01610

Motif M01933

Motif M01972

Motif M00246

Motif M00245

Motif M00243

Motif M00235

Motif M01636

Motif M01509

Motif PBM0126

Motif PBM0104

Motif PBM0103

Motif PBM0132

Motif PBM0135

Motif PBM0116

Motif M02040

Motif M01985

Motif M01940

Motif M01700

Motif M00654

Motif M01925

Motif PBM0027

Motif M01559

Motif M01961

Motif M01104

Motif M01903

Motif M01629

Motif M00008

Motif PBM0054

Motif M01512

Motif M01839

Motif M01002

Motif M00740

Motif M00431

Motif PBM0121

Motif PBM0114

Motif PBM0113

Motif PBM0107

Motif M00916

Motif M00466

Motif M01220

Motif M01617

Motif M00752

Motif M00712

Motif PBM0105

Motif PBM0094

Motif PBM0130

Motif PBM0128

Motif PBM0119

Motif PBM0100

Motif PBM0110

Motif PBM0101

Motif PBM0097

Motif M02037

Motif M01992

Motif M01989

Motif M01987

Motif M01982

Motif M01980

Motif M01979

Motif M01976

Motif M00262

Motif M01660

Motif MA0048.1

Motif M01243

Motif M00940

Motif M00939

Motif M01492

Motif M00263

Motif PBM0077

Motif M00920

Motif M00516

Motif M00113

Motif M00017

Motif PBM0023

Motif M01550

Motif M01517

Motif PBM0082

Motif M01613

Motif M01649

Motif M01962

Motif M01122

Motif MA0115.1

Motif MA0017.1

Motif M00158

Motif M00765

Motif M00762

Motif M01544

Motif M01251

Motif M01634

Motif M00345

Motif M00652

Motif M01175

Motif M00649

Motif MA0003.1

Motif M00470

Motif M01948

Motif M00698

Motif M00373

Motif M01947

Motif M01648

Motif M00697

Motif M00694

Motif M00036

Motif M01862

Motif M01820

Motif M00917

Motif M00691

Motif M00513

Motif M01863

Motif M01187

Motif M01186

Motif M00179

Motif M00178

Motif M01861

Motif M00981

Motif M00946

Motif M00375

Motif M00039

Motif M00514

Motif M00121

Motif PBM0198

Motif PBM0181

Motif M00369

Motif M00187

Motif M01577

Motif M00236

Motif MA0059.1

Motif M00154

Motif M00497

Motif MA0024.1

Motif M00739

Motif M00738

Motif M00737

Motif M00427

Motif M00426

Motif M00050

Motif M01958

Motif MA0162.1

Motif M01219

Motif MA0057.1

Motif M01840

Motif M00971

Motif M00918

Motif M00014

Motif M01635

Motif M01643

Motif MA0039.2

Motif M00264

Motif M00425

Motif M00492

Motif PBM0172

Motif PBM0171

Motif M00693

Motif M01673

Motif M00069

Motif MA0117.1

Motif M00024

Motif M01736

Motif M00001

Motif M01793

Motif M01927

Motif PBM0013

Motif M01558

Motif PBM0200

Motif M00985

Motif M00539

Motif M00945

Motif M00371

Motif M00370

Motif M00220

Motif M00660

Motif M01742

Motif M00512

Motif M01650

Motif M00763

Motif M01681

Motif M01035

Motif M01752

Motif M00064

Motif PBM0191

Motif PBM0176

Motif M00175

Motif PBM0162

Motif PBM0145

Motif MA0138.2

Motif M01256

Motif M00325

Motif M00256

Motif M01028

Motif MA0139.1

Motif M01200

Motif M01911

Motif M01607

Motif M01816

Motif M01642

Motif M01916

Motif M00973

Motif MA0007.1

Motif M00651

Motif M00281

Motif M01662

Motif M01511

Motif M00279

Motif M01050

Motif MA0088.1

Motif M00469

Motif PBM0081

Motif MA0156.1

Motif M01298

Motif M01852

Motif M00806

Motif M00443

Motif M01909

Motif PBM0156

Motif PBM0140

Motif PBM0079

Motif M01054

Motif M01964

Motif M00696

Motif M00303

Motif M01111

Motif M00993

Motif M00104

Motif M00210

Motif M00280

Motif PBM0005

Motif M01646

Motif M00065

Motif MA0111.1

Motif M01768

Motif M00930

Motif M00795

Motif MA0091.1

Motif M00746

Motif M00150

Motif M01945

Motif PBM0134

Motif M01785
